<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div id="child">
            child
        </div>
    </div>
    <!-- 
        parentNode.replaceChild(newNode,targetNode) 替换某个元素
     -->
    <script>
        var app = document.getElementById("app")
        var child = document.getElementById("child")
        var p = document.createElement("p")
        p.innerHTML = "hello world"
        app.replaceChild(p,child)
        console.log(app);
    </script>
</body>
</html>